package com.sunforum.forum.app;

import com.sunforum.common.annotation.Log;
import com.sunforum.common.core.controller.BaseController;
import com.sunforum.common.core.domain.AjaxResult;
import com.sunforum.common.core.page.TableDataInfo;
import com.sunforum.common.enums.BusinessType;
import com.sunforum.common.utils.poi.ExcelUtil;
import com.sunforum.forum.domain.PcArticle;
import com.sunforum.forum.domain.vo.PcArticleVo;
import com.sunforum.forum.service.IPcArticleService;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * pc_贴子/文章Controller
 * 
 * @author sunforum
 * @date 2025-04-23
 */
@RestController
@RequestMapping("/app/article")
public class AppPcArticleController extends BaseController
{
    @Autowired
    private IPcArticleService pcArticleService;

    @GetMapping("/list")
    public TableDataInfo list(PcArticle pcArticle)
    {
        startPage();
        List<PcArticleVo> list = pcArticleService.selectPcArticleData(pcArticle);
        return getDataTable(list);
    }


    @GetMapping(value = "/{id}")
    public AjaxResult getArticle(@PathVariable("id") String id)
    {
        PcArticleVo vo = pcArticleService.getArticle(id);
        return success(vo);
    }


}
